﻿using System;
using FunctionalCLR.Core;

namespace FunctionalCLR.Shell.Function {
    public class UnsetNode : ContextFuncNode {

        public UnsetNode()
            : base() {
            this.Precedence = 0;
            base.Value = "unset";
        }

        public override FuncNode GetReversedFunction(int index) {
            throw new NotImplementedException();
        }

        public override object Evaluate() {
            foreach (Node child in this.Children) {
                Context.RemoveVariable(child.Value);
            }

            return string.Empty;
        }
    }
}
